#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

void Adjust(int* p,int numsSize)
{
	int left = 0, right = numsSize-1;
	while (right > left)
	{
		if (*(p + left) % 2 != 0)
			left++;
		if (*(p + right) % 2 == 0)
			right--;
		if (*(p + left) % 2 == 0 && *(p + right) % 2 != 0)
		{
			int t = *(p + left);
			*(p + left) = *(p + right);
			*(p + right) = t;
			left++;
			right--;
		}
	}
}



int main()
{
	int nums[10] = { 1,2,3,4,5,4,6,7,8,9 };
	Adjust(nums, 10);
	for (int i = 0; i < 10; i++)
		printf("%d ", nums[i]);
	return 0;
}